from django.db import models

# Create your models here.
# from __future__ import unicode_literals
from django.db import models

class Book(models.Model):
    book_name = models.CharField(max_length=64)
    add_time = models.DateTimeField(auto_now_add=True)

    def __unicode__(self):
        return self.book_name

class loginUser(models.Model):
    name = models.CharField(max_length=10)
    password = models.CharField(max_length=10)
    auth = models.CharField(max_length=300,blank=True,null=True)

    def __str__(self):
        return self.name

class imgCagery(models.Model):
    name = models.CharField(max_length=10)
    imgOrder = models.CharField(max_length=10)

    def __str__(self):
        return self.name


class report(models.Model):
    title = models.CharField(max_length=10)
    add_time = models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return self.title

class youHuiQuan(models.Model):
    title = models.CharField(max_length=10)
    price = models.CharField(max_length=10)
    image = models.CharField(max_length=50,blank=True,null=True)
    status = models.IntegerField(blank=True,null=True)
    add_time = models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return self.title

class menuList(models.Model):
    status = models.IntegerField(default=1)
    type = models.IntegerField(default=1)
    name = models.CharField(max_length=20)
    icon = models.CharField(max_length=50,blank=True,null=True)
    frontpath = models.CharField(max_length=100,blank=True,null=True)
    level = models.IntegerField(blank=True,null=True)
    parent = models.ForeignKey('self',null=True,blank=True,on_delete=models.SET_NULL,related_name='child')
    sort = models.IntegerField(default=50)
    def __str__(self):
        return self.name
